projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9896278
)
fix potential buffer overflow in lowranceusr4 reader.
author
tsteven4
<tsteven4@gmail.com>
Wed, 8 Nov 2017 13:39:32 +0000
(06:39 -0700)
committer
tsteven4
<tsteven4@gmail.com>
Wed, 8 Nov 2017 13:39:32 +0000
(06:39 -0700)
lowranceusr4.cc
patch
|
blob
|
history
diff --git
a/lowranceusr4.cc
b/lowranceusr4.cc
index f2470453e154d1c4528095a3a8669bb0e6f6bf1a..53436d8be5dd5ef571b615de5e33a5dc7bdf1bce 100644
(file)
--- a/
lowranceusr4.cc
+++ b/
lowranceusr4.cc
@@
-85,8
+85,8
@@
lowranceusr4_readstr(char* buf, const int maxlen, gbfile* file, int bytes_per_ch
buf[0] = '\0'; /* seems len=-1 means no string */
return 0;
} else if (len) {
- if (len > maxlen
*bytes_per_char
) {
- len = maxlen
*bytes_per_char
;
+ if (len > maxlen) {
+ len = maxlen;
}
if (bytes_per_char == 1) {
bytesread += gbfread(buf, 1, len, file);